package com.example.hellodemo.pageView2;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Lifecycle;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;

import android.os.Bundle;
import android.widget.TableLayout;

import com.example.hellodemo.R;

public class FragmentAdapterActivity extends AppCompatActivity {

    /*
    * Android中使用双层ViewPager2+Fragment+TabLayout 实现顶部Tab和底部菜单Fragment联动切换  https://blog.csdn.net/zhong_zihao/article/details/105294014
    * */
    private ViewPager2 viewPager2;
    private TableLayout tableLayout;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fragment_adapter);

        tableLayout = findViewById(R.id.page_table_layout);
        viewPager2 = findViewById(R.id.view_page_fragment);

    }

}


    class AdapterFragmentPager extends FragmentStateAdapter{


        public AdapterFragmentPager(@NonNull FragmentActivity fragmentActivity) {
            super(fragmentActivity);
        }

        public AdapterFragmentPager(@NonNull Fragment fragment) {
            super(fragment);
        }

        @NonNull
        @Override
        public Fragment createFragment(int position) {
            return null;
        }

        @Override
        public int getItemCount() {
            return 0;
        }
    }
